<template>
  <div>
    <BasicModal
      v-bind="$attrs"
      :title="t('routes.demo.partManager.versionShow')"
      @register="register"
      @ok="handleSubmit"
      @cancel="handleCancel"
      :destroyOnClose="true"
      :minHeight="600"
      :width="1200"
      ><BasicTable @register="registerTable" />
    </BasicModal>
  </div>
</template>

<script setup lang="ts">
  import { BasicModal, useModalInner } from '/@/components/Modal';
  import { BasicTable, useTable } from '/@/components/Table';
  import { useI18n } from '/@/hooks/web/useI18n';

  import { getVersionShowColumns } from './tableData';

  const { t } = useI18n();

  const handleSubmit = () => {
    handleCancel();
  };

  const handleCancel = () => {
    closeModal();
  };

  // 初始化弹窗
  const [register, { setModalProps, closeModal }] = useModalInner(() => {
    setModalProps({ confirmLoading: false });
  });

  // 初始化表格
  const [registerTable, { reload, setLoading }] = useTable({
    columns: getVersionShowColumns(),
    bordered: true,
    showIndexColumn: false,
    showTableSetting: true, // 显示表格设置工具
    tableSetting: { fullScreen: true }, // 表格设置工具配置
    // pagination: { pageSize: 5, pageSizeOptions: ['5', '10', '15', '20'], defaultPageSize: 5 },
    canResize: true,
    rowKey: 'id',
  });
</script>

<style scoped></style>
